package chixing.day07.homwork;

public class FullTimeEmployee extends MyEmployee{
    private double bonus;//奖金

    public FullTimeEmployee(){}
    public FullTimeEmployee(double bonus) {
        this.bonus = bonus;
    }

    public FullTimeEmployee(int empNo, String empName, double empBalanceSalary, double bonus) {
        super(empNo, empName, empBalanceSalary);
        this.bonus = bonus;
    }

    /**
     * 重载了父类的calculateSalary()方法
     * 如果有奖金
     * @return 基本工资 + 奖金
     */
    public double calculateSalary(){
        return this.getEmpBalanceSalary() + bonus;
    }



    public double getBonus() {
        return bonus;
    }

    public void setBonus(double bonus) {
        this.bonus = bonus;
    }

    @Override
    public String toString() {
        return "FullTimeEmployee{" +
                "bonus=" + bonus +
                '}';
    }
}
